Object.defineProperty(exports, "__esModule", {
    value: !0
});

var t = {
    tel: new RegExp("^((\\d{1,5})?(((0\\d{2,3}|400|800)-?)?\\d{7,8}(-\\d{3,5})?|1\\d{10}))$"),
    logoChar: new RegExp("(?:[一-龻\\w])"),
    notEmpty: /\S/,
    mobile: new RegExp("1\\d{10}"),
    email: /^.+@.+\..+$/
};

exports.validateForm = function(e) {
    var r = {
        name: [ {
            test: function(t) {
                return t.length;
            },
            errMsg: "官网名称不能为空"
        } ],
        companyname: [ {
            test: function(t) {
                return t.length;
            },
            errMsg: "公司名不能为空"
        } ],
        tel: [ {
            test: function(e) {
                return t.tel.test(e);
            },
            errMsg: "电话格式有误"
        } ],
        mchid: [ {
            test: function(t) {
                return 10 === ("" + t).length;
            },
            errMsg: "商户号至少十位"
        } ],
        key: [ {
            test: function(t) {
                return !/[^\dA-Za-z]/.test(t);
            },
            errMsg: "api密钥只能包含数字和英文"
        }, {
            test: function(t) {
                return 32 === t.length;
            },
            errMsg: "api密钥长度为32位"
        } ],
        mobile: [ {
            test: function(e) {
                return t.mobile.test(e);
            },
            errMsg: "手机格式错误"
        } ],
        email: [ {
            test: function(e) {
                return t.email.test(e);
            },
            errMsg: "邮箱格式错误"
        } ]
    }, n = [];
    return Object.keys(e).forEach(function(t) {
        if (r[t]) {
            var o = r[t].find(function(r) {
                return !r.test(e[t]);
            });
            o && n.push(o.errMsg);
        }
    }), !n.length || (wx.showModal({
        title: "验证提示",
        content: n.join(";\r\n"),
        showCancel: !1
    }), !1);
}, exports.getLogoChar = function(e) {
    var r = e.match(t.logoChar);
    return r ? r[0] : "";
}, exports.isLocalFile = function(t) {
    return /^wxfile:\/\//.test(t) || /^http:\/\/tmp\//.test(t);
};